<#include "/public/macro.html">
<div class="uk-layui-form">
    <form class="layui-form uk-form" action="/setting/sms/save.html">
    	<input type="hidden" name="templettype" value="${sysDic.id!''}">
        <div class="layui-form-item">
            <label class="layui-form-label">模板名称：</label>
            <div class="layui-input-inline" style="width:400px;">
                <input type="text" name="name" required lay-verify="required" placeholder="请输入模板名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">模板内容：</label>
            <div class="layui-input-inline" style="width:400px;">
                <textarea name="templettext" placeholder="请输入内容" class="layui-textarea" style="resize:none;height:150px;"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">开启发送频率：</label>
				<div class="layui-input-inline">
					<input type="checkbox" name="switchfrequency" lay-filter="switchfrequency" lay-skin="switch" value="1" lay-text="开|关" >
				</div>
			</div>
			<div class="layui-inline switchfrequency" style="margin-left: -175px;display: none;">
				<div class="layui-input-inline" style="width: 100px;">
					<select name="frequency">
						<option value="month">每月</option>
						<option value="week">每周</option>
						<option value="day">每天</option>
						<option value="hour">每小时</option>
					</select>
				</div>
			</div>
			<div class="layui-inline switchfrequency" style="margin-left: -23px;display: none;">
				<div class="layui-input-inline">
					<input type="text" name="frequencynum" lay-verify="number" placeholder="请输入条数" autocomplete="off" class="layui-input">
				</div>
				<i style="position: absolute;padding-top: 10px;font-style: normal;">条</i>
			</div>
		</div>
        <div class="layui-form-button">
            <div class="layui-button-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script>
layui.use('form', function(){
  var form = layui.form;
  form.render();
  form.on('switch(switchfrequency)', function(data){
		if(data.elem.checked){
			$('.switchfrequency').show();
		}else{
			$('.switchfrequency').hide();
		}
	}); 
});
</script>